package com.toivan.mt.fragment;

import android.os.Bundle;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.shizhefei.fragment.LazyFragment;
import com.toivan.mt.R;
import com.toivan.mt.adapter.MtBeautyAdapter;
import com.toivan.mt.model.MtBeauty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MtBeautyFragment extends LazyFragment {

    private final List<MtBeauty> beautyList = new ArrayList<>();

    @Override
    protected void onCreateViewLazy(Bundle savedInstanceState) {
        super.onCreateViewLazy(savedInstanceState);

        setContentView(R.layout.fragment_recyclerview);

        beautyList.clear();
        beautyList.addAll(Arrays.asList(MtBeauty.values()));

        RecyclerView beautyRV = (RecyclerView) findViewById(R.id.recyclerView);
        MtBeautyAdapter adapter = new MtBeautyAdapter(beautyList);
        beautyRV.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
        beautyRV.setAdapter(adapter);
    }
}
